<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich">
<h:head>
	<title>Fiap Airport Web</title>
</h:head>
<h:body>
	<ui:include src="/cliente/menu.xhtml"/>
	<rich:panel header="Lista de Reserva">
	<h:form>
	
		<h:dataTable id="carrinhoTable" value="#{compraPassagensBean.compras}" var="item">
			<f:facet name="header">
				<h:outputText value="Lista de Clientes" />
			</f:facet>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Trecho" />
				</f:facet>
				<h:outputText value="#{item.trecho.descricao}" />
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Passagens Executivas" />
				</f:facet>
				<h:outputText value="#{item.quantidadePassagensExecutiva}" />
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Passagens Econômicas" />
				</f:facet>
				<h:outputText value="#{item.quantidadePassagensEconomica}" />
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Valor" />
				</f:facet>
				<h:outputText value="#{item.valorCompra}" />
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="" />
				</f:facet>
				<h:commandLink value="Remover" action="#{compraPassagensBean.removerItem(item)}" />
			</h:column>
		</h:dataTable>
		
    	<p>
			<h:commandButton action="#{compraPassagensBean.finalizarCompra()}" value="Finalizar Compra" />
			<h:commandButton action="#{compraPassagensBean.adicionarItem()}" value="Adicionar Item" />
		</p>
	</h:form>
	</rich:panel>
</h:body>
</html>
